#!/usr/bin/ruby -w
#
# $Id: item_search3,v 1.4 2010/02/20 16:49:13 ianmacd Exp $

require 'amazon/aws/search'

include Amazon::AWS
include Amazon::AWS::Search

is = ItemSearch.new( 'Baby', { 'Keywords' => 'pants',
		               'MinimumPrice' => '2500',
			       'MaximumPrice' => '4999' } )
is.response_group = ResponseGroup.new( 'Small' )

req = Request.new
req.locale = 'us'

resp = req.search( is )
items = resp.item_search_response[0].items[0].item

printf( "Search returned %d items.\n", items.size )

items.each { |item| puts item, '' }
